package control;

import java.util.ArrayList;

import store.TaxCalculator;
import model.Treat;

public abstract class Station implements Runnable{
	
	protected ArrayList<Treat> treats;
    protected TaxCalculator calc;	
	protected static String[] snackNames = {"Breakfast Sandwich", "Doughnut", "Coolatta"};
	//protected static String[] actions = {"View Treats", "Make Treat", "Quit"};

	
	public Station(ArrayList<Treat> treats, TaxCalculator calc){
		this.treats = treats;
		this.calc = calc;
	}
	
	
	public synchronized void run(){
		String[] actions = getActions();
		int choice = Menu.getMenuOption("What would you like to do?", actions);
		while (choice != actions.length - 1)
		{	try
		{
			interactWithUser(choice);
		}
			catch (Exception e){
				System.out.println(e.getStackTrace());
				e.printStackTrace();
			}
			choice = Menu.getMenuOption("What would you like to do?", actions);;
		}
	}

	protected abstract void interactWithUser(int choice) throws Exception;	
	abstract String[] getActions();
}
